<template>
  <div class="home">
    <ul class="show-scroll commonBox">
      <li v-for="item in 30" :key="item">llldfiv大师iwi</li>
    </ul>
    <v-chart :option="barOption" :aaa='val'/>
    <el-button @click="aaa">点击</el-button>
  </div>
</template>

<script>
import {ref,watch} from 'vue'
export default {
  name: 'Home',
  computed: {
    barOption() {
      return {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: this.data,
            type: 'line'
          }
        ]
      }
    }
  },
  setup(){
    let data=ref([150, 230, 224, 218, 135, 147, 160])
    let val=ref(10)
  
    // watch(val,()=>{
    //   console.log(111);
    // })
    return {data,val}
  },
  methods:{
    aaa(){
      this.data=[22, 34, 11, 34, 21, 44, 31]
      this.val=30
      // console.log(this.data);
    }
  }
}
</script>

<style lang='less' scoped>
.home{
  background: pink;
}
ul {
  height: 200px;
}
</style>
